The present invention relates to a table generating apparatus for generating a table based on heading information and table data.
In recent years, document processing apparatuses such as a DTP (desk top publishing) apparatus and a word processor have been spreading. Since tables are important components of a document, in particular, a technical document, almost all the document processing apparatuses can deal with tables.
FIGS. 2 and 3 show tables in a generalized form. Many of tables appearing in a document consist of heading spaces and data spaces, and items appearing in heading spaces are called heading items. Many of tables appearing in a document express a corresponding relationship between combinations of heading items and data. A combination of heading items is called a heading item string. Table data entered in a data space at a crossing point of a particular row and a particular column corresponds to a heading item string as a combination of heading item strings in those heading item row and column. It may be the case that a plurality of heading items appear in a single row or a single column. For example, in the case of a row and a column indicated by dashed lines in FIG. 2, a heading item string (B, F, b, i), which is a combination of row heading items B and F and column heading items b and i, corresponds to table data "12".
Tables as described above are used to search data corresponding to a heading item string or to recognize a general feature of data corresponding to a heading item string. A table should have a form suitable for its purpose. Therefore, it is desired that even if tables express the same contents, i.e., the same corresponding relationship between heading item strings and table data, they have different forms suitable for their respective purposes.
For example, the table of FIG. 3 is suitable for examining how the data varies when the heading item is fixed to a certain heading item A because data to be found from the heading item A exist in a single sequence. On the other hand, this table is not suitable for examining how the data varies when the heading item is fixed to another heading item B because data to be found from the heading item B appear discretely. If it is expected to examine data with the heading item fixed to B, a table should be generated so that the heading item B exists in a single row or column.
Tables should have different forms depending on sizes and shapes of indication spaces. For example, in the case of a table in which item contents are written horizontally, if indication spaces are narrow, each frame of an item elongates vertically, i.e., there frequently occurs row folding. This type of table is hard to read. In such a case, to provide an easy-to-read table, it is necessary to change the form of the table by, for instance, properly interchanging row headings and column headings to reduce the number of column headings.
Further, the form of a table changes depending on preferences of a person who generates a table. Therefore, for example, when a user attempts to incorporate a table generated by another person into his own document, he naturally would like to alter the form of the table in accordance with his preferences.
As described above, a high-quality document, which is easy to read and reflects preferences of a person who generates a document, can be generated by allowing the same contents, i.e., the same corresponding relationship between heading item strings and table data to be expressed in different forms.
In conventional DTP apparatuses and word processors, a table is generated by a user in the following manner.
1) Determining the shape of a frame (ruled table) composed of ruled lines and the positional relationship between respective items.
2) Determining positions of the ruled lines considering the number of characters of a content of each item and other factors.
3) Actually generating ruled lines in accordance with the shape of the ruled table and the positions of the ruled lines determined above.
4) Inputting item contents to the respective item spaces.
In this table generation method, it is easy to change, after a table is generated, the thickness and kind of a ruled line, the character font of an item, etc. However, to change the shape of the ruled table or the positional relationship between items, a table needs to be re-generated starting from step 1).
In the buried-command type table generating method such as the tabular environment of LaTeX and tbl of roff, a table is generated by describing a text including, in a mixed manner, character strings of item contents and commands for instructing how to draw ruled lines. Absolute positions and lengths of ruled lines and a layout of item contents are automatically calculated by formatting. However, it is the same as in the case of DTP apparatuses and word processors that the shape of the ruled table and the positional relationship between respective items should be determined first.
For example, Japanese Patent Application Unexamined Publication No. Hei. 3-37757 discloses a technique of automatically generating a relatively complex table in which heading items are expressed hierarchically. Even in this technique, it is necessary that a hierarchical relationship of heading items and table data have been set at the time of inputting information. Since the hierarchical relationship has already been set, it is difficult to change the form of a table; that is, it is difficult to generate a new table having a single heading item B from the table of FIG. 3 in which heading items appear discretely.
According to the conventional techniques described above, to change the form of a table relating to the shape of a ruled table and the positional relationship between respective items, a user needs to re-generate a table from the start, which is very cumbersome. Further, it is difficult to reuse an already generated table in a different document or share it by a plurality of users to improve the efficiency of generating a document. This is so because, according to the conventional techniques, there exist strict limitations on the alteration of the form of a table and, therefore, it is difficult to change the form of a table in accordance with preferences of a user or conditions, such as contexts and indication spaces, of the document.
On the other hand, data bases, including a relational data base, are commonly used as an apparatus for searching for data using an item string as a search key. Since search results obtained by using such a data base give a corresponding relationship between an item string and data, in many cases they can be expressed in the form of a table. Even in the prior art, it is possible to automatically convert data base search results to a table having a simple frame of horizontal and vertical lines crossing each other and display it. However, to express search results as a more readable table having a complex shape, it is necessary to generate, on each occasion, a program depending on the data structure of the search results and the shape of a table. To generate a program for automatically generating a table on each occasion, a person who generates it should be in generating a program. Even if he does, an operation of generating a program is a cumbersome work. It is conceivable that he generates a table using a table generating function of a conventional word processor etc. However, since search results by a data base tend to have an enormous amount, the inputting of such search results is also a cumbersome work.